<?php
namespace Plugin\Device\Schema;

use Plugin\Device\Model\RdDeviceRod;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 装置组
 */
#[Schema(title: 'RdDeviceRodSchema')]
class RdDeviceRodSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '装置名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'stand_id', title: '站点ID', type: 'int')]
    public string $stand_id;

    #[Property(property: 'radar_num', title: '雷达数量', type: 'int')]
    public string $radar_num;

    #[Property(property: 'online', title: '在线状态1在线2离线', type: 'int')]
    public string $online;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'created_by', title: '创建者', type: 'bigint')]
    public string $created_by;

    #[Property(property: 'updated_by', title: '更新者', type: 'bigint')]
    public string $updated_by;




    public function __construct(RdDeviceRod $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->stand_id = $model->stand_id;
       $this->radar_num = $model->radar_num;
       $this->online = $model->online;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->created_by = $model->created_by;
       $this->updated_by = $model->updated_by;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'stand_id' => $this->stand_id ,'radar_num' => $this->radar_num ,'online' => $this->online ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'created_by' => $this->created_by ,'updated_by' => $this->updated_by];
    }
}